home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="GENERATOR" content="amaya 5.2" />
- <title>Creating Graphics with the Palette</title>
- <style type="text/css"> </style>
- <link href="../style.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body xml:lang="en" lang="en">
-
- <table border="0" summary="toc">
- <tbody>
- <tr>
- <td><img alt="W3C" src="../../images/w3c_home" /> <img alt="Amaya"
- src="../../images/amaya.gif" /></td>
- <td><p><a href="working_with_graphics.html" accesskey="p"><img alt="previous"
- src="../../images/left.gif" /></a>
- <a href="../SVG.html" accesskey="t"><img alt="top" src="../../images/up.gif" /></a>
- <a href="moving_graphics.html" accesskey="n"><img alt="next"
- src="../../images/right.gif" /></a></p>
- </td>
- </tr>
- </tbody>
- </table>
-
- <div id="page_body">
- <h1>Creating Graphics with the Palette</h1>
-
- <p>To create a new SVG element in a document, move the insertion point to the
- position where you want to insert it, and then click the
- <strong>Graphics</strong> button. The <strong>Graphics</strong> button (<img
- src="../../images/Graph.gif" alt="Graphics button" />) displays a palette that stays on the screen until you
- click <strong>Done</strong> on the palette.</p>
-
- <p>The available graphics elements are:</p>
- <ul>
- <li>A line, <code>line</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <line y1="3px" x1="0px" x2="17px" y2="20px" style="stroke: #B20000"
- stroke="1"/>
- </svg>
- </li>
- <li>A rectangle, <code>rect</code> in SVG with no <code>rx</code> or
- <code>ry</code> attributes, <svg xmlns="http://www.w3.org/2000/svg"
- width="2cm" height="0.6cm">
- <rect x="6px" width="22px" height="18px"
- style="fill: #FFCB69; stroke: #0071FF" stroke="1"/>
- </svg>
- </li>
- <li>A rectangle with rounded corners, <code>rect</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <rect rx="6px" stroke="1" width="23px" height="18px"
- style="fill: #E5E500; stroke: #4C00E5"/>
- </svg>
- </li>
- <li>A circle, <code>circle</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <circle cy="10px" cx="12px" r="10px"
- style="fill: #C1FFE9; stroke: #FF0000" stroke="1"/>
- </svg>
- </li>
- <li>An ellipse, <code>ellipse</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <ellipse cy="10px" cx="20px" rx="15px" ry="10px" style="fill: #B795FF"
- stroke="1"/>
- </svg>
- </li>
- <li>A polyline, <code>polyline</code> in SVG,<svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <polyline points="4,16 23,0 37,16 55,6" stroke="1"
- style="stroke: #0000B2; fill: #FFA069"/>
- </svg>
- </li>
- <li>A polygon, <code>polygon</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.7cm">
- <polygon points="2,16 15,0 28,12 45,4 46,16 17,16 14,11" stroke="1"
- style="fill: #C8FF95; stroke: #000000"/>
- </svg>
- </li>
- <li>An open curve, <code>path</code> in SVG,<svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <path stroke="blue" fill="none"
- d="M 0,16 C 0,15 4,6 9,7 C 13,7 12,16 16,16 C 20,15 24,1 22,0"
- style="stroke: #0071FF" stroke-width="2px"/>
- </svg>
- </li>
- <li>A closed curve, <code>path</code> in SVG, <svg
- xmlns="http://www.w3.org/2000/svg" width="2cm" height="0.6cm">
- <path stroke="black" fill="none"
- d="M 14,4 C 11,4 8,0 6,1 C 3,1 1,4 1,7 C 0,9 2,12 5,14 C 7,15 13,14 16,14 C 17,13 21,12 23,11 C 24,9 29,7 29,4 C 28,1 24,0 22,0 C 19,0 16,3 14,4 Z"
- style="fill: #FFE9C1; stroke: #B20000"/>
- </svg>
- </li>
- </ul>
- <ul>
- <li>An embedded HTML fragment, <code>foreignObject</code> in SVG,<svg
- xmlns="http://www.w3.org/2000/svg" width="6cm" height="45px">
- <rect y="0" x="27px" width="140px" height="45px" style="fill: #C1FFFF"
- stroke="1"/>
- <foreignObject width="140px" y="0" x="20px">
-
- <div xmlns="http://www.w3.org/1999/xhtml">
- <ul>
- <li>First item</li>
- <li>Second item</li>
- </ul>
- </div>
- </foreignObject>
- </svg>
- </li>
- <li>A SVG text, <code>text</code> in SVG<svg
- xmlns="http://www.w3.org/2000/svg" width="9.5cm" height="1.2cm">
- <text y="33px" x="13px"
- style="font-family: helvetica; font-size: 12pt; fill: #0000B2">A
- character string in SVG
- </text>
- </svg>
- </li>
- </ul>
-
- <h2>Selecting a Shape in the Palette</h2>
-
- <p>When you select a shape in the palette and the selection is in the HTML
- structure of the document, Amaya creates a new SVG element just at the
- beginning of the current selection and inserts the selected shape into this
- new SVG. Amaya generates SVG drawings as blocks, between paragraphs. To
- display a drawing inline, you must create it between paragraphs then edit the
- source code to move it.</p>
-
- <p>When the current selected element is a SVG element, the new shape is added
- to the current SVG drawing. The new shape is added after and can overlap
- previous shapes.</p>
-
- <p>The creation of a shape requires direct interaction:</p>
- <ul>
- <li>To create a rectangle, you first select the position of the left corner
- by pressing the left mouse button. While holding down the button, move
- the mouse to the position of the opposite corner, then release the
- button. The shape is now defined.
- <p></p>
- </li>
- <li>To create a circle or an ellipse, you first select the position of the
- center by pressing the left mouse button. While holding down the button,
- move the mouse to the right and/or bottom of the shape, then release the
- button. The shape is now defined.
- <p></p>
- </li>
- <li>For a polyline and polygon, enter each point by clicking the
- corresponding position with the left mouse button. To indicate the last
- point, click with the middle or right button.</li>
- </ul>
-
- <h2>Inserting an Image</h2>
-
- <p>You can insert an image within a SVG drawing. Choose
- <strong>Image</strong> from the <strong>Types</strong> menu or click the
- <strong>Insert Image</strong> button from the button bar and proceed in the
- same way as in HTML.</p>
-
- <p>To insert a mathematical expression into a SVG drawing, click the
- <strong>Math</strong> palette when the selection is within an SVG. Amaya will
- generate a SVG <code>foreignObject</code> to embed the MathML markup.</p>
-
- <h2>See Also:</h2>
- <ul>
- <li><a href="working_with_graphics.html">Working with Graphics</a></li>
- <li><a href="../Math.html">Editing Mathematics</a></li>
- <li><a
- href="../editing_mathematics/the_math_palette_and_the_types.html">The
- Math Palette and the Types/Math menu</a></li>
- </ul>
-
- <p>รก</p>
- </div>
-
- </body>
- </html>
-